//
// Created by Castle on 2025/10/31.
//

#include <iostream>
using namespace std;

int main() {
    // 阶乘和
    int n,sum = 0,res = 1;
    cin >> n;
    for (int i = 1;i <= n; i++) {
        // 求阶乘
        res = 1;
        for (int j = 1;j <= i;j++) {
            res *= j;
        }
        sum += res;
    }
    cout << "阶乘和：" << sum << endl;
    return 0;
}